﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="AdmMessageManage.aspx.cs"
    MaintainScrollPositionOnPostback="true" Inherits="LIMS.Web.AdmMessageManage" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script type="text/javascript">
        var se;
        function GetRepeterColor(id) {
            se = id.style.backgroundColor;
            id.style.backgroundColor = '#1E90FF';
        }
        function SetRepeterColor(id) {
            id.style.backgroundColor = se;
        } 
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div style="text-align: center; width: 800px; margin-left: 50px;">
        <table width="900" border="0" cellspacing="0" cellpadding="0">
            <tr>
                <td>
                </td>
                <td height="10" align="left" style="text-align: center; font-size: 24px;">
                    &nbsp;&nbsp;<strong>留言管理</strong>
                </td>
            </tr>
            <tr>
                <td height="30" align="left" style="width: 40px; text-align: center;">
                    &nbsp;&nbsp;<strong></strong>
                </td>
                <td height="30">
                    <div style="width: 660px; text-align: center; font-size: 20px; padding: 5px;">
                        <font size="2" style="font-size: 20px;">回复状态</font>&nbsp;
                        <asp:DropDownList ID="ddlMessageStatus" runat="server" AutoPostBack="True" Style="font-size: 20px;"
                            OnSelectedIndexChanged="ddlMessageStatus_SelectedIndexChanged">
                            <asp:ListItem Text="全部" Value="-1"></asp:ListItem>
                            <asp:ListItem Text="已处理" Value="1"></asp:ListItem>
                            <asp:ListItem Text="未处理" Value="0"></asp:ListItem>
                        </asp:DropDownList>
                    </div>
                </td>
            </tr>
            <tr>
                <td height="30" colspan="2" align="left">
                    <asp:Repeater ID="rpMessage" runat="server" OnItemCommand="rpMessage_ItemCommand">
                        <HeaderTemplate>
                            <table border="1" width="100%">
                                <tr align="center">
                                    <th width="6%">
                                        序号
                                    </th>
                                    <th width="7%">
                                        留言人
                                    </th>
                                    <th width="8%">
                                        留言时间
                                    </th>
                                    <th width="10%">
                                        留言标题
                                    </th>
                                    <th width="20%">
                                        详细内容
                                    </th>
                                    <th width="5%">
                                        是否回复
                                    </th>
                                    <th width="9%">
                                        回复人
                                    </th>
                                    <th width="23%">
                                        回复内容
                                    </th>
                                    <th width="10%">
                                        操作
                                    </th>
                                </tr>
                        </HeaderTemplate>
                        <ItemTemplate>
                            <tr align="center" style='background-color: <%#(Container.ItemIndex%2==0)?"silver;":"#808080"%>'
                                onmouseover="GetRepeterColor(this)" onmouseout="SetRepeterColor(this)">
                                <td>
                                    <%#Container.ItemIndex+1 %>
                                </td>
                                <td>
                                    <%#StuIdToName(Eval("mesID").ToString())%>
                                </td>
                                <td>
                                    <%#Eval("mesTime", "{0:yyyy-MM-dd}")%>
                                </td>
                                <td align="center">
                                    <%# Eval("mesTitle")%>
                                </td>
                                <td align="left">
                                    <%#SubString(Eval("mesDetail").ToString(),15)%>
                                </td>
                                <td>
                                    <%#StatusCodeToWords( Eval("mesStatusCode"))%>
                                </td>
                                <td>
                                    <%#adminIdToName(Eval("mesAdminID"))%>
                                </td>
                                <td>
                                    <%#SubString(Eval("mesReply"),16)%>
                                </td>
                                <td align="center">
                                    <asp:Button ID="btnDelMessage" runat="server" Text="删除" CommandName="myDel" CommandArgument='<%#Eval("mesID") %>'
                                        OnClientClick='return confirm("确定删除?")' />
                                    <asp:Button ID="btnReplyMessage" runat="server" Text="回复" CommandName="myReply" CommandArgument='<%#Eval("mesID") %>' />
                                </td>
                            </tr>
                        </ItemTemplate>
                        <FooterTemplate>
                            </table>
                        </FooterTemplate>
                    </asp:Repeater>
                </td>
            </tr>
        </table>
        <br />
        <br />
        <div id="divReply" runat="server">
            <table width="700" border="0" cellpadding="0" cellspacing="0" bgcolor="#CCCCCC">
                <tr>
                    <td height="60" bgcolor="#FFFFFF">
                        &nbsp;&nbsp;<strong>留言编辑</strong>
                    </td>
                </tr>
                <tr>
                    <td>
                        <table width="700" border="0" cellspacing="1" cellpadding="0">
                            <tr>
                                <td width="100" height="30" align="right" bgcolor="#FFFFFF">
                                    <font color="#FF0000" size="2">*&nbsp;</font><font size="2">留言标题</font>
                                </td>
                                <td width="500" height="30" bgcolor="#FFFFFF">
                                    &nbsp;<asp:TextBox ID="txtMesTitle" runat="server" CssClass="box-3" Width="90%" MaxLength="50"
                                        Height="27" Style="font-size: 18px;"></asp:TextBox>
                                    <br />
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtMesTitle"
                                        Enabled="false" Display="Dynamic" ErrorMessage="留言标题不能为空" ForeColor="#AA11FF"></asp:RequiredFieldValidator>
                                </td>
                            </tr>
                            <tr>
                                <td width="100" height="30" align="right" bgcolor="#FFFFFF">
                                    <font color="#FF0000" size="2">*&nbsp;</font><font size="2">留 言 人</font>
                                </td>
                                <td width="500" height="30" bgcolor="#FFFFFF">
                                    &nbsp;<asp:TextBox ID="txtStuName" runat="server" CssClass="box-3" MaxLength="50"
                                        Width="90%" Height="27" Style="font-size: 18px;"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td align="right" bgcolor="#ffffff" height="30" width="100">
                                    <font color="#FF0000" size="2">*&nbsp;</font><font size="2">留言内容</font>
                                </td>
                                <td bgcolor="#ffffff" height="30" width="500">
                                    &nbsp;<asp:TextBox ID="txtMesDetail" runat="server" CssClass="box-3" TextMode="MultiLine"
                                        Style="font-size: 18px;" Width="90%" MaxLength="50" Rows="10" Font-Size="Large"
                                        Height="100px"></asp:TextBox>
                                    <br />
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="txtMesDetail"
                                        Enabled="false" Display="Static" ErrorMessage="必须填写详细信息！" ForeColor="#AA11FF"></asp:RequiredFieldValidator>
                                </td>
                            </tr>
                            <tr>
                                <td align="right" bgcolor="#ffffff" height="30">
                                    <font color="#FF0000" size="2">*</font> <font size="2">回复内容</font> &nbsp;
                                </td>
                                <td bgcolor="#ffffff" height="30" width="500">
                                    &nbsp;<asp:TextBox ID="txtReview" runat="server" TextMode="MultiLine" Width="90%"
                                        MaxLength="50" Rows="10" Height="100px" Style="font-size: 18px;"></asp:TextBox>
                                    <br />
                                    &nbsp; &nbsp; &nbsp; &nbsp;<asp:RequiredFieldValidator ID="RequiredFieldValidator4"
                                        Enabled="false" runat="server" ControlToValidate="txtReview" Display="Static"
                                        ErrorMessage="必须填写回复内容" ForeColor="#AA11FF"></asp:RequiredFieldValidator>
                                </td>
                            </tr>
                            <tr>
                                <td align="right" bgcolor="#ffffff" height="15">
                                </td>
                                <td bgcolor="#ffffff" width="500">
                                </td>
                            </tr>
                            <tr>
                                <td bgcolor="#FFFFFF">
                                </td>
                                <td height="40" bgcolor="#FFFFFF">
                                    <asp:Button ID="btnOK" runat="server" Text="保存提交" OnClick="btnOK_Click" Style="float: left;
                                        margin-left: 150px; height: 30px; width: 85px; font-size: 18px;" />
                                    <asp:Button ID="btnReset" runat="server" Text="重置" OnClick="btnReset_Click" Style="margin-left: 0px;
                                        height: 30px; width: 85px; font-size: 18px;" />
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
            </table>
        </div>
    </div>
    </form>
</body>
</html>
